class Tool(object):
    count = 0

    def __init__(self, name):
        self.name = name
        # 类名.属性，相当于调用类属性
        Tool.count += 1
        self.count = Tool.count

    def print_Tool_count(self):
        print(f"Tool.count:{Tool.count}")

    def print_self_count(self):
        print(f"self.count:{self.count}")
    @classmethod
    def print_cls_count(cls):
        print(f"cls.count:{cls.count}")


p1 = Tool("锤子")
p2 = Tool("钳子")
p1.print_Tool_count()
p1.print_self_count()
p1.print_cls_count()

